﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QldtSdh.BLL;
using QldtSdh.DAL.Models;
using QldtSdh.GUI.Common;
using QldtSdh.GUI.Utils;
using QldtSdh.Utils;
namespace QldtSdh.GUI.DaoTao
{
    public partial class FormThongTinChiTietHocVien : BaseDialog
    {
        public FormThongTinChiTietHocVien(string maHocVien)
        {
            InitializeComponent();
            InitInterface(maHocVien);
        }

        void InitInterface(string maHocVien)
        {
            HocVien hocVien = BizHocVien.GetByID(maHocVien);
            if (hocVien != null)
            {
                txtMaHocVien.Text = hocVien.MaHocVien;
                txtHo.Text = hocVien.HoDem;
                txtTen.Text = hocVien.Ten;
                chkGioiTinh.Checked = hocVien.GioiTinh;
                txtNgaySinh.Text = hocVien.NgaySinh;
                txtDiaChi.Text = hocVien.DiaChi;
                txtEmail.Text = hocVien.Email;
                txtQuocTich.Text = hocVien.QuocTich;
                txtSoDienThoai.Text = hocVien.SoDienThoai;
            }
            else
            {
                txtMaHocVien.Text = "";
                txtHo.Text = "";
                txtTen.Text = "";
                chkGioiTinh.Checked = false;
                txtNgaySinh.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now);
                txtDiaChi.Text = "";
                txtEmail.Text = "";
                txtQuocTich.Text = "Việt Nam";
                txtSoDienThoai.Text = "";
            }
        }
    }
}
